package com.cslg.yougou.front.controller;


import com.cslg.yougou.front.pojo.Result;
import com.cslg.yougou.front.service.ShopCarService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zx
 * @since 2020-11-07
 */
@Api(value = "用户controller",tags = "购物车接口")
@RestController
@RequestMapping("/front/shop-car")
public class ShopCarController {
    @Autowired
    ShopCarService shopCarController;

    @GetMapping("/shop_car")
    public Result getshopcar(@ApiParam(value = "用户的token", required = true) String token,
                             @ApiParam(value = "用户的时间戳", required = true) String current_time) {
        return shopCarController.getshopcar(token, current_time);
    }

    @GetMapping("/add_shopcar")
    public Result addshopcar(@ApiParam(value = "用户的token", required = true) String token,
                             @ApiParam(value = "用户的时间戳", required = true) String current_time,
                             @ApiParam(value="购物车id", required=true) int shopcarid) {
        return shopCarController.addshopcar(token, current_time , shopcarid);
    }
    @GetMapping("/sub_shopcar")
    public Result subshopcar(@ApiParam(value = "用户的token", required = true) String token,
                             @ApiParam(value = "用户的时间戳", required = true) String current_time,
                             @ApiParam(value="购物车id", required=true) int shopcarid){
        return shopCarController.subshopcar(token, current_time , shopcarid);}
}
